<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>箭头函数的参数</title>
    <script>
        /* 
        箭头函数的参数
        
        */
        const fn = (x,y) => {
            console.log(`x`,`${x}`)
            console.log(`y`,`${y}`)
            let result=x+y
            console.log(`result`,`${result}`)
            return result
        }

        fn(3,5)


//================================================================

        const fn2 = (x=10,y=20,z=30) => {   //给箭头函数设置了默认值
            console.log(`x`,`${x}`)
            console.log(`y`,`${y}`)
            console.log(`z`,`${z}`)
            
            let result=x+y

            console.log(`result`,`${result}`)
            return result
            }

        fn2(3,5)         //实参小于形参，前两个会被赋值，第三个默认值会生效
    </script>
</head>

<body>

</body>

</html>